<template>
    <el-dialog v-model="visible" title="面试面板" :close-on-press-escape="false" @open="init">
        <ul>
            <li style="margin-right: 10px">
                <el-tag type="success" v-if="interviewArrange.phaseName==='初试'">{{interviewArrange.phaseName}}</el-tag>
                <el-tag type="warning" v-if="interviewArrange.phaseName==='复试'">{{interviewArrange.phaseName}}</el-tag>
                <el-tag type="danger" v-if="interviewArrange.phaseName==='终试'">{{interviewArrange.phaseName}}</el-tag>
            </li>
            <li>
                面试岗位：{{interviewArrange.position}}
            </li>
        </ul>
        <el-form>
            <el-form-item>
                面试记录：<el-input type="textarea" :rows="4" v-model="interviewArrange.record"/>
            </el-form-item>
            <el-form-item>
                <el-select placeholder="面试结果" v-model="interviewArrange.result">
                    <el-option v-for="(item) in interviewResultOptions" :value="item.value" :label="item.label"/>
                </el-select>
            </el-form-item>
        </el-form>
        <template #footer>
            <el-button type="default" @click="visible=false">取消</el-button>
            <el-button type="primary" @click="submit">确认</el-button>
        </template>
    </el-dialog>
</template>

<script>
import {updateInterviewArrange} from "../../../../network/per/interview_arrange";

export default {
    name: "InterviewPanel",
    data(){
        return{
            visible: false,
            interviewArrange:{
                "id": 7,
              "position": "行政专员",
              "phaseName": "初试",
              "result": null,
              "record": null,
              "resume": {
                  "id": 1,
                "name": "陆萱萱",
                "sex": "女",
                "birth": "2000-04-13",
                "highestEducation": 1,
                "academicDegree": 0,
                "idCard": "6748727568675823956",
                "graduationInstitutions": "社会人体艺术学校",
                "major": "模特",
                "domicilePlace": "湖南",
                "politics": 1,
                "nation": null,
                "nativePlace": "澳门",
                "graduationDate": "2017-04-13",
                "wedlock": null,
                "height": 161,
                "health": "良好",
                "contactPhone": "15573020013",
                "email": "gjahgjkh@.cc00",
                "hobbies": "摄影",
                "computerApplicationAbility": null,
                "computerGradeCertificate": null,
                "selfEvaluation": "长相甜美、风靡全球",
                "personalPhoto": "/src/assets/img/per_photo/陆萱萱.jpeg",
                "remark": null,
                "status": 0,
                "createTime": "2022-04-13 21:50:18",
                "updateTime": null,
                "deleted": 0,
                "educationExperienceList": null,
                "workExperienceList": null,
                "resumeClassify": null
                }
            },
            interviewResultOptions: []
        }
    },
    methods:{
        submit(){
            let params = {
                id: this.interviewArrange.id,
                status: 4,
                result: this.interviewArrange.result,
                record: this.interviewArrange.record
            }
            updateInterviewArrange(params).then(data=>{
                console.log('data',data)
                this.visible = false
            })
        },
        loadInterviewResultOptions(){
            this.interviewResultOptions = this.$dictMap.get('interview_result');
        },
        init(){
            this.loadInterviewResultOptions();
        }
    },
    created() {

    }
}
</script>

<style scoped>

</style>
<style>
.el-select{
    width: 140px;
}
.el-select-dropdown__wrap{
    width: 140px;
}
.el-select-dropdown__item{
    width: 100%;
}
</style>